from django.urls import path, re_path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView
from users.views import CreateUserViews, RegisterViews, MobileViews, SmsApiView

urlpatterns = [
    # 获取token
    path('jwt/access/', TokenObtainPairView.as_view()),
    # 刷新token
    path('jwt/refresh/', TokenRefreshView.as_view()),
    # 校验token
    path('jwt/verify/', TokenVerifyView.as_view()),
    path('createuser/', CreateUserViews.as_view()),
    # 注册功能
    path('register/', RegisterViews.as_view()),
    # 手机号唯一注册
    re_path(r'^mobile/(?P<mobile>1[3-9]\d{9})/$', MobileViews.as_view()),
    # 容联云短信发送
    re_path(r'^sendsms/(?P<mobile>1[3-9]\d{9})/$', SmsApiView.as_view())
]